home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Term / Extras / Source / gtlayout-source.lha / LTP_DrawPicker.c < prev    next >
C/C++ Source or Header  |  1996-03-18  |  879b  |  43 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1996 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. VOID
  15. LTP_DrawPicker(struct RastPort *RPort,BOOL UpDirection,LONG Left,LONG Top,LONG Width,LONG Height)
  16. {
  17.     LONG i,Len,ArrowHeight,ArrowWidth,LineHeight,Start,Pos;
  18.  
  19.     LineHeight    = (Height + 15) / 16;
  20.     ArrowHeight    = Height - (Height + 7) / 8;
  21.     ArrowWidth    = Width;
  22.  
  23.     for(i = 0 ; i < ArrowHeight ; i++)
  24.     {
  25.         Len = ((ArrowWidth * (i + 1)) / ArrowHeight) & ~1;
  26.  
  27.         if(Len < ArrowWidth)
  28.             Len++;
  29.  
  30.         Start = Left + (ArrowWidth - Len) / 2;
  31.  
  32.         if(UpDirection)
  33.             Pos = Top + i;
  34.         else
  35.             Pos = Top + ArrowHeight - 1 - i;
  36.  
  37.         LTP_DrawLine(RPort,Start,Pos,Start + Len - 1,Pos);
  38.     }
  39.  
  40.     for(i = 0 ; i < LineHeight ; i++)
  41.         LTP_DrawLine(RPort,Left,Top + Height - 1 - i,Left + Width - 1,Top + Height - 1 - i);
  42. }
  43.